package com.simple.middle.test.redis.constant;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * 项目: pagination
 *
 * 功能描述: 用户纬度常量
 *
 * @author: WuChengXing
 *
 * @create: 2023-05-24 15:38
 **/
public class UserStatisticConstant {

    /**
     * 用户签到redis前缀
     */
    public static final String USER_SIGN_PREFIX = "SIGN:" + getYear() + ":USER:UID:";
    public static final String USER_SIGN_MONTH_PREFIX = "SIGN:" + getYear() + ":MONTH";
    public static final String USER_SIGN_WEEK_PREFIX = "SIGN:" + getYear() + ":WEEK";
    public static final String USER_SIGN_DAY_PREFIX = "SIGN:" + getYear() + ":DAY";

    public static final String CITY_POSITION_PREFIX = "HANGZHOU";
    public static final String USER_POSITION_PREFIX = "GEO:USER:UID:";

    /**
     * 支持日活5亿数据量
     */
    public static final int DAY_UNSIGNED_NUM = 32;

    /**
     * 支持周活32亿数据量
     */
    public static final int WEEK_UNSIGNED_NUM = 32;

    /**
     * 支持月活171亿数据量
     */
    public static final int MONTH_UNSIGNED_NUM = 34;

    public static String getYear() {
        DateTimeFormatter yyyyMMDft = DateTimeFormatter.ofPattern("yyyy");
        return LocalDate.now().format(yyyyMMDft);
    }

    public static void main(String[] args) {
        System.out.println(USER_SIGN_PREFIX);
    }
}
